package org.footballmanager.pandafootball.system.form.impl;

import lombok.Getter;
import lombok.Setter;
import org.footballmanager.pandafootball.system.domain.FootMission;
import org.footballmanager.pandafootball.system.form.SearchForm;
import tk.mybatis.mapper.entity.Example;

import java.io.Serializable;
import java.util.Date;

@Getter
@Setter
public class FootMissionSearchForm extends SearchForm implements Serializable {
	private static final long serialVersionUID = 8090668615941861533L;
	protected String userName;
	protected Boolean complete;
	protected Date createTime;

	public Example buildSearchCommond() {
		Example example = new Example(FootMission.class);
		Example.Criteria criteria = example.createCriteria();
		if (complete != null) {
            criteria.andEqualTo("complete", complete);
		}
        criteria.andEqualTo("delFlag", 0);
        example.orderBy("createTime desc");
		return example;
	}

}
